
import React, { Component } from 'react'

export default class index extends Component {

  constructor(props){
    super(props);
    this.state={
      count:6
    }
  }

  chuan=()=>{
    this.props.toParent(this.state.count);
  }

  render() {
    return (
      <div>
        <h1>子组件A</h1>
        <input type="button" value="传给B" onClick={this.chuan}  />
      </div>
    )
  }
}
